<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <steen.rabol@gmail.com>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: PortalToDoHistoryRecord.php 289 2008-11-14 05:34:40Z steen.rabol@gmail.com $
 */

Prado::using('Application.Common.Data.PortalActiveRecord');
Prado::using('Application.Common.Data.PortalUserRecord');

class PortalToDoHistoryRecord extends PortalActiveRecord
{
	const TABLE='tbltodohistory';

	public $id;
	public $todoid;
	public $answer;
	public $created		= 0;
	public $userid	= 0;

	private	$_createdbyname	= null;

	public static function finder($className=__CLASS__)
	{
		return parent::finder($className);
	}

	public function getCreatedByName()
	{
		if($this->_createdbyname === null)
		{
			$u = PortalUserRecord::finder()->findByid($this->userid);
			if($u)
				$this->_createdbyname = $u->name;
			else
				$this->_createdbyname = Prado::localize('None');;
		}

		return $this->_createdbyname;
	}
}
?>